<?php

//include 'Conexao.php';
include '../dao/ItemDAO.php';

$itemdao = new ItemDAO();

if (isset($_POST["numeroItem"]) && isset($_POST["idproposta"])) {
	$numeroItem = $_POST["numeroItem"];
	$idproposta = $_POST["idproposta"];
	$result = $itemdao->getItemById($idproposta, $numeroItem);
}else{
 	echo "Erro : ".$_POST["numeroItem"]." - ".$_POST["idproposta"];
}

//$result->obra = utf8_encode($result->obra);
if(!$result){
	echo 1;
}else{
	echo json_encode($result);
}

?>